frequencyTableDialog <-
function(){
    require(TeachingExtras)
    initializeDialog(title = gettext("Frequency table (non grouped numerical data)",domain="R-RcmdrPlugin.TeachingExtras"))
    xBox <- variableListBox(top, Numeric(), title = gettext("Variable (pick one)",domain="R-RcmdrPlugin.TeachingExtras"))
    onOK <- function() {
        x <- getSelection(xBox)
        if (length(x) == 0) {
            errorCondition(recall = frequencyTableDialog, message = gettext("You must select a variable.",domain="R-RcmdrPlugin.TeachingExtras"))
            return()
        }
        closeDialog()
        .activeDataSet <- ActiveDataSet()
        command <- paste("frequencyTable(", .activeDataSet, "$", x, ")", sep = "")
        doItAndPrint(command)
        tkfocus(CommanderWindow())
    }
    OKCancelHelp(helpSubject = "frequencyTable")
    tkgrid(getFrame(xBox), sticky = "nw")
    tkgrid(buttonsFrame, sticky = "w")
    dialogSuffix(rows = 2, columns = 2)
}

